import request from '@/utils/request'

export function getRoles(params) {
  return request.get('/sys/role', { params })
}

export function doDelRoles(id) {
  return request.delete(`/sys/role/${id}`)
}

export function doAddRoles(data) {
  return request.post('/sys/role', data)
}

export function doEditRoles(data) {
  return request.put(`/sys/role/${data.id}`, data)
}

export function getRoleDetail(id) {
  return request.get('/sys/role/' + id)
}

export function savePermission(data) {
  return request.put(`/sys/role/assignPrem`, data)
}
